﻿using System;
using System.Html.DOM;

namespace jQueryLib
{
    partial class JQuery
    {
        public static string Trim(string str)
        {
            return null;
        }

        public readonly static object Support;

        /// <summary>
        /// Return a number representing the current time.
        /// </summary>
        /// <returns></returns>
        public static long Now()
        {
            return 0;
        }

        /// <summary>
        /// Translate all items in an array or object to new array of items.
        /// </summary>
        /// <param name="array">The Array to translate.</param>
        /// <param name="func">object func(element, idx)</param>
        /// <returns></returns>
        public static R[] Map<T, R>(T[] array, Func<R, T, int> func)
        {
            return null;
        }

        /// <summary>
        /// Translate all items in an array or object to new array of items.
        /// </summary>
        /// <param name="arrayOrObject">The Array/Object to translate.</param>
        /// <param name="func">object func(value, keyOrIndex)</param>
        /// <returns></returns>
        public static R[] Map<R>(object arrayOrObject, Func<R, object, object> func)
        {
            return null;
        }

        /// <summary>
        /// Convert an array-like object into a true JavaScript array.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static Array MakeArray(Object obj)
        {
            return null;
        }

        public static bool IsWindow(object obj)
        {
            return false;
        }

        /// <summary>
        /// Check to see if an object is a plain object (created using "{}" or "new Object").
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool IsPlainObject(object obj)
        {
            return false;
        }

        public static bool IsNumeric(object obj)
        {
            return false;
        }

        public static bool IsFunction(object obj)
        {
            return false;
        }

        /// <summary>
        /// Check to see if an object is empty (contains no properties).
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool IsEmptyObject(object obj)
        {
            return false;
        }

        public static bool IsArray(object obj)
        {
            return false;
        }

        /// <summary>
        /// Check to see if a DOM element is within another DOM element.
        /// </summary>
        /// <param name="container"></param>
        /// <param name="contained"></param>
        /// <returns></returns>
        public static bool Contains(HtmlElement container, HtmlElement contained)
        {
            return false;
        }

        /// <summary>
        /// Search for a specified value within an array and return its index (or -1 if not found).
        /// </summary>
        /// <param name="val"></param>
        /// <param name="arr"></param>
        /// <returns></returns>
        public static bool InArray(object val, Array arr)
        {
            return false;
        }

        /// <summary>
        /// Search for a specified value within an array and return its index (or -1 if not found).
        /// </summary>
        /// <param name="val"></param>
        /// <param name="arr"></param>
        /// <param name="fromIdx"></param>
        /// <returns></returns>
        public static bool InArray(object val, Array arr, int fromIdx)
        {
            return false;
        }

        /// <summary>
        /// Finds the elements of an array which satisfy a filter function. The original array is not affected.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="R"></typeparam>
        /// <param name="arr"></param>
        /// <param name="func"></param>
        /// <returns></returns>
        public static R[] Grep<T, R>(T[] arr, Func<R, T, int> func)
        {
            return null;
        }

        /// <summary>
        /// Finds the elements of an array which satisfy a filter function. The original array is not affected.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="R"></typeparam>
        /// <param name="arr"></param>
        /// <param name="func">in function, "this" will be the global window object.</param>
        /// <param name="invert">If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.</param>
        /// <returns></returns>
        public static R[] Grep<T, R>(T[] arr, Func<R, T, int> func, bool invert)
        {
            return null;
        }
    }
}
